﻿namespace SchoolExercise
{
    using System;

    internal class Student : Person, ICommentable
    {
        private string comment;
        private byte numberInClass;

        public Student(string nameOfStudent, byte numberInClass)
            : base(nameOfStudent)
        {
            this.NumberInClass = numberInClass;
        }

        public Student(string nameOfStudent, byte numberInClass, string studentComment)
            : this(nameOfStudent, numberInClass)
        {
            this.Comment = studentComment;
        }

        public byte NumberInClass
        {
            get
            {
                return this.numberInClass;
            }

            set
            {
                if (value > 0)
                {
                    this.numberInClass = value;
                }
                else
                {
                    throw new ArgumentOutOfRangeException("Problem s nomera na studenta");
                }
            }
        }

        public string Comment
        {
            get
            {
                return this.comment;
            }

            set
            {
                this.comment = value;
            }
        }
    }
}